/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.spring.Model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author kerife
 */
@Entity
@Table(name = "grupo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Grupo.findAll", query = "SELECT g FROM Grupo g"),
    @NamedQuery(name = "Grupo.findByNumeroGrupo", query = "SELECT g FROM Grupo g WHERE g.grupoPK.numeroGrupo = :numeroGrupo"),
    @NamedQuery(name = "Grupo.findByIdAsignatura", query = "SELECT g FROM Grupo g WHERE g.grupoPK.idAsignatura = :idAsignatura"),
    @NamedQuery(name = "Grupo.findBySalonLetra", query = "SELECT g FROM Grupo g WHERE g.salonLetra = :salonLetra"),
    @NamedQuery(name = "Grupo.findByHorariom", query = "SELECT g FROM Grupo g WHERE g.horariom = :horariom"),
    @NamedQuery(name = "Grupo.findByRfc", query = "SELECT g FROM Grupo g WHERE g.rfc = :rfc"),
    @NamedQuery(name = "Grupo.findByIdSalon", query = "SELECT g FROM Grupo g WHERE g.idSalon = :idSalon"),
    @NamedQuery(name = "Grupo.findByVacantes", query = "SELECT g FROM Grupo g WHERE g.vacantes = :vacantes")})
public class Grupo implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected GrupoPK grupoPK;
    @Basic(optional = false)
    @NotNull
    @Column(name = "salon_letra")
    private char salonLetra;
    @Basic(optional = false)
    @NotNull
    @Column(name = "horariom")
    private int horariom;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "rfc")
    private String rfc;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_salon")
    private int idSalon;
    @Column(name = "vacantes")
    private Integer vacantes;

    public Grupo() {
    }

    public Grupo(GrupoPK grupoPK) {
        this.grupoPK = grupoPK;
    }

    public Grupo(GrupoPK grupoPK, char salonLetra, int horariom, String rfc, int idSalon) {
        this.grupoPK = grupoPK;
        this.salonLetra = salonLetra;
        this.horariom = horariom;
        this.rfc = rfc;
        this.idSalon = idSalon;
    }

    public Grupo(int numeroGrupo, int idAsignatura) {
        this.grupoPK = new GrupoPK(numeroGrupo, idAsignatura);
    }

    public GrupoPK getGrupoPK() {
        return grupoPK;
    }

    public void setGrupoPK(GrupoPK grupoPK) {
        this.grupoPK = grupoPK;
    }

    public char getSalonLetra() {
        return salonLetra;
    }

    public void setSalonLetra(char salonLetra) {
        this.salonLetra = salonLetra;
    }

    public int getHorariom() {
        return horariom;
    }

    public void setHorariom(int horariom) {
        this.horariom = horariom;
    }

    public String getRfc() {
        return rfc;
    }

    public void setRfc(String rfc) {
        this.rfc = rfc;
    }

    public int getIdSalon() {
        return idSalon;
    }

    public void setIdSalon(int idSalon) {
        this.idSalon = idSalon;
    }

    public Integer getVacantes() {
        return vacantes;
    }

    public void setVacantes(Integer vacantes) {
        this.vacantes = vacantes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (grupoPK != null ? grupoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Grupo)) {
            return false;
        }
        Grupo other = (Grupo) object;
        if ((this.grupoPK == null && other.grupoPK != null) || (this.grupoPK != null && !this.grupoPK.equals(other.grupoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.Grupo[ grupoPK=" + grupoPK + " ]";
    }
    
}
